package com.chenl.provider.DEMOS.Spring.Spel;

import com.chenl.provider.DTO.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SpelController {

    @Autowired
    SpelService spelService;

    @SpelAnno(key = "#userInfo.name")
    @PostMapping("/test")
    public String method(@RequestBody UserInfo userInfo){
        spelService.method(userInfo);
        return "ok";
    }
}
